import request from '@/utils/request'

// 根据id获取公司信息
export const getCompanyInfo = id => request({
  url: `/company/${id}`
})

// 获取所有角色
export const roleListApi = params => request({
  url: '/sys/role',
  params
})

// 新增角色
export const addRoleApi = data => request({
  url: '/sys/role',
  method: 'POST',
  data
})

// 删除角色
export const delRoleApi = id => request({
  url: `/sys/role/${id}`,
  method: 'DELETE'
})

// 根据id获取角色详情
export const getRoleInfoById = id => request({
  url: `/sys/role/${id}`
})

// 编辑角色
export const updateRoleApi = (id, data) => request({
  url: `/sys/role/${id}`,
  method: 'PUT',
  data
})

// 给角色分配权限
export const assignPmsApi = data => request({
  url: '/sys/role/assignPrem',
  method: 'PUT',
  data
})